//
// Created by user on 2022/1/14.
//
#include <iostream>
#include <string>
using namespace std;
bool isPalindrome(string s) {
    unsigned int n = s.length();
    if(n<=1){return true;}
    int left = 0;
    int right = n-1;
    while (left<right){
        while (left<right && !isdigit(s.at(left)) && !isalpha(s.at(left))){
            left++;
        }
        while (left<right && !isdigit(s.at(right)) && !isalpha(s.at(right))){
            right--;
        }

        if(left>right || toupper(s.at(left))!=toupper(s.at(right))){
            return false;
        }
        left++;
        right--;
    }
    return true;
}